package com.hoshiibuy.dictionary.controller;

import com.hoshiibuy.dictionary.service.IDicCurrSetSerivce;
import com.hoshiibuy.dictionary.entity.DicCurrSetVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author guangjinwei
 * @create 2019-04-18
 */

@RestController
@RequestMapping("dicCurrSet/")
@Api(value = "汇率信息管理", tags = {"汇率信息操作接口"})
public class DicCurrSetController {

    private final Logger LOGGER = LoggerFactory.getLogger(DicCurrSetController.class);
    @Autowired
    IDicCurrSetSerivce dicCurrSetSerivce;

    @RequestMapping(value = "/saveDicDataBank", method = RequestMethod.POST)
    @ApiOperation(
            value = "保存汇率信息",
            notes = "保存汇率信息",
            produces = "application/json, application/xml",
            consumes = "application/json, application/xml")
    public void saveDicCurrSet(DicCurrSetVo dicCurrSetVo){

        dicCurrSetSerivce.saveDicCurrSet(dicCurrSetVo);
    }

    @RequestMapping(value = "/findDicCurrSetList", method = RequestMethod.GET)
    @ApiOperation(
            value = "查询汇率信息",
            notes = "查询汇率信息",
            produces = "application/json, application/xml",
            consumes = "application/json, application/xml")
    public List<DicCurrSetVo> findDicCurrSetList(){
        List<DicCurrSetVo> dicCurrSetList = dicCurrSetSerivce.findDicCurrSetList();
        LOGGER.debug("test: "+dicCurrSetList.toString());
        return dicCurrSetList;
    }

}
